project("Kernel")

add_executable(Kernel
        KernelExample.cpp
)
add_dependencies(Kernel LibDGGSKernel)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_link_libraries(Kernel
            LibDGGSKernelD
    )
    # 复制需要的dll文件
    add_custom_command(
            TARGET Kernel
            POST_BUILD
            COMMAND ${CMAKE_COMMAND} -E copy
            ${DGGS_OUT_DIR}/LibDGGSKernel/LibDGGSKernelD.dll
            ${CMAKE_BINARY_DIR}/Example/cpp/Kernel/LibDGGSKernel_d.dll COMMENT "Copying DLL to DGGS_TestSuite directory")
else ()
    target_link_libraries(Kernel
            LibDGGSKernel
    )
    # 复制需要的dll文件
    add_custom_command(
            TARGET Kernel
            POST_BUILD
            COMMAND ${CMAKE_COMMAND} -E copy
            ${DGGS_OUT_DIR}/LibDGGSKernel/LibDGGSKernel.dll
            ${CMAKE_BINARY_DIR}/Example/cpp/Kernel/LibDGGSKernel.dll COMMENT "Copying DLL to DGGS_TestSuite directory")
endif ()
